package anaydis.animation.model;

import com.sun.istack.internal.NotNull;

import java.util.List;
import java.util.Random;

public class RandomDataModel
        extends SortDataModel
{
    public List<Integer> create(int size)
    {
        final List<Integer> result = initializeEmptyList(size);

        fill(result, size, size);

        return result;
    }

    protected void fill(@NotNull final List<Integer> result, int lengthToFill, int size)
    {
        final Random random = new java.util.Random(1);

        for (int i = 0; i < lengthToFill; i++)
        {
            result.set(i, random.nextInt(lengthToFill) * (size / lengthToFill) + 1);
        }
    }

    public String toString()
    {
        return "Random";
    }
}